package com.taomeishu.mailcrazy.checkers;

import com.taomeishu.mailcrazy.AbstractMailExistChecker;
import com.taomeishu.mailcrazy.checkers.neteasy.NeteasyResultParser;
import com.taomeishu.mailcrazy.parser.ResultParser;
import com.taomeishu.mailcrazy.util.RandomUtil;

public class NeteasyMailExistChecker extends AbstractMailExistChecker {

	private String baseUrl = "http://reg.email.163.com/mailregAll/checkuname.do?uname=";
	
	private String referer = "http://reg.email.163.com/mailregAll/reg0.jsp?from=163mail_right";
	
	private NeteasyResultParser neteasyResultParser = new NeteasyResultParser();
	
	@Override
	protected String makeRequestUrl(String username, String domainName) {
		return baseUrl + username + "&random=" + RandomUtil.getRandomDouble();
	}

	@Override
	protected boolean usePostMethod() {
		return false;
	}

	@Override
	protected ResultParser getResultParser() {
		return neteasyResultParser;
	}

	@Override
	protected String getReferer() {
		return referer;
	}

}
